home *** CD-ROM | disk | FTP | other *** search
- library plugin;
- uses
- {$IFDEF WIN32}{$H+}
- ShareMem,
- {$ENDIF}
- Wizard, ExptIntf, ToolIntf, VirtIntf, Forms, Dialogs, SysUtils;
-
-
- procedure HandleException;
- begin
- if Assigned(ToolServices) then
- ToolServices.RaiseException(ReleaseException)
- end {HandleException};
-
-
- Type
- TPlugInExpert = class(TIExpert)
- public
- { Expert Style }
- function GetStyle: TExpertStyle; override;
- { Expert Strings }
- function GetIDString: String; override;
- function GetName: String; override;
- {$IFDEF WIN32}
- function GetAuthor: String; override;
- {$ENDIF}
- function GetMenuText: String; override;
- function GetState: TExpertState; override;
- { Launch the Expert }
- procedure Execute; override;
- end {TPlugInExpert};
-
-
- function TPlugInExpert.GetStyle: TExpertStyle;
- begin
- Result := esStandard
- end {GetStyle};
-
- function TPlugInExpert.GetIDString: String;
- begin
- Result := 'DrBob.TPlugInExpert'
- end {GetIDString};
-
- function TPlugInExpert.GetName: String;
- begin
- Result := 'Dr.Bob''s PlugIn Wizard Expert'
- end {GetName};
-
- {$IFDEF WIN32}
- function TPlugInExpert.GetAuthor: String;
- begin
- Result := 'Dr.Bob'
- end {GetAuthor};
- {$ENDIF}
-
- function TPlugInExpert.GetMenuText: String;
- begin
- Result := 'No Project Wizard Available';
- if Assigned(ToolServices) then with ToolServices do
- try
- if (GetUnitCount > 0) and
- (GetFormCount > 0) and
- (Length(GetProjectName) > 0) then
- Result := '&Project Wizard for ' +
- ExtractFileName(GetProjectName) + '...'
- except
- HandleException
- end
- end {GetMenuText};
-
- function TPlugInExpert.GetState: TExpertState;
- begin
- Result := [];
- if Assigned(ToolServices) then with ToolServices do
- try
- if (GetUnitCount > 0) and
- (GetFormCount > 0) and
- (Length(GetProjectName) > 0) then Result := [esEnabled]
- except
- HandleException
- end
- end {GetState};
-
- procedure TPlugInExpert.Execute;
- begin
- if Assigned(ToolServices) then with ToolServices do
- try
- with TWizardForm.Create(nil) do
- try
- ShowModal
- finally
- Free
- end
- except
- HandleException
- end
- end {Execute};
-
-
- function InitExpert(Delphi: TIToolServices;
- RegisterProc: TExpertRegisterProc;
- var Terminate: TExpertTerminateProc): Boolean;
- {$IFDEF WIN32} stdcall; {$ELSE} export; {$ENDIF}
- begin
- ExptIntf.ToolServices := Delphi; { Save! }
- if ToolServices <> nil then
- Application.Handle := ToolServices.GetParentHandle;
- Result := RegisterProc(TPlugInExpert.Create)
- end {InitExpert};
-
-
- exports
- InitExpert name ExpertEntryPoint resident,
- InitExpert name 'INITEXPERT0017'; { for Delphi 3 }
-
- begin
- end.
-